Device, system and method to provide an auto-focus capability based on object distance information

ABSTRACT

Techniques and mechanisms for determining a configuration of the lens system. In an embodiment, respective distances from a reference are determined for each of a plurality of objects that are observable via the lens system. Based on the object distances, counts of in-focus objects are determined, each for a corresponding focal configuration of the lens system. Each such count of in-focus objects represents a total number of objects that are (or would be) in focus during the corresponding focal configuration, wherein a respective one of the plurality of objects is at a near depth of field of the corresponding focal configuration. In another embodiment, a preference of one focal configuration over another focal configuration is determined based on the counts of in-focus objects.

BACKGROUND 1. Technical Field

This disclosure relates generally to the field of optics and inparticular, but not exclusively, relates to operation of an image sensorwith a variable focus lens system.

2. Background Art

In optics, the depth of field (“DOF”) is the range in a scene between anearer distance and a further distance, between which distances objectsin the image can appear to be acceptably sharp. A fixed-focus lens canonly precisely focus on a single depth within a scene, as such sharpnessgradually decreases on either side of this focus distance. Objects thatfall within the depth of field are considered to have acceptablesharpness.

Digital imaging devices, such as digital cameras, often include a lensassembly that focuses image light onto an image sensor that measures theimage light and generates an image based on the measurements. A variablefocus lens can adjust its focus distance, such that it can be focused atdifferent distances at different times. This enables the imaging deviceto translate the depth of field to focus on objects at any of a varietyof distances. Conventional imaging devices often support auto-focusfunctionality to facilitate the changing of focal distance. As thenumber and variety of form factors for imaging devices continue to growover time, there is expected to be an increased demand for solutionsthat provide responsive and/or otherwise efficient auto-focusfunctionality.

BRIEF DESCRIPTION OF THE DRAWINGS

The various embodiments of the present invention are illustrated by wayof example, and not by way of limitation, in the figures of theaccompanying drawings and in which:

FIG. 1 is a functional block diagram illustrating elements of a systemto determine a focal configuration according to an embodiment.

FIG. 2 is a flow diagram illustrating elements of a method for operatingan image sensor device according to an embodiment.

FIG. 3A is a plan view of an environment including a device to provideauto-focus capability according to an embodiment.

FIG. 3B is a graph illustrating processes performed to determine a focalconfiguration according to an embodiment.

FIG. 4 is a flow diagram illustrating elements of a process to determinea focal configuration according to an embodiment.

FIG. 5 shows various views illustrating features of an environment inwhich an image sensor device is to provide auto-focus capabilityaccording to an embodiment.

DETAILED DESCRIPTION

Embodiments described herein variously provide techniques and mechanismsfor determining a type of focus to be provided with a lens system. Sucha lens system may be configured, in some embodiments, based on anevaluation of whether objects observable through the lens system mightbe variously in-focus or out-of-focus—e.g., given a particular apertureand/or other operational characteristic of an image sensor that isoptically coupled to the lens system. Where it is determined that onelens system configuration results in (or would result in) more objectsbeing in-focus, as compared to another lens system configuration, asignal may be generated, according to an embodiment, to indicate arelative preference of the one lens system configuration over the otherlens system configuration.

In the following description numerous specific details are set forth toprovide a thorough understanding of the embodiments. One skilled in therelevant art will recognize, however, that the techniques describedherein may be practiced without one or more of the specific details, orwith other methods, components, materials, etc. In other instances,well-known structures, materials, or operations are not shown ordescribed in detail to avoid obscuring certain aspects. Referencethroughout this specification to “one embodiment” or “an embodiment”means that a particular feature, structure, or characteristic describedin connection with the embodiment is included in at least one embodimentof the present invention. Thus, the appearances of the phrases “in oneembodiment” or “in an embodiment” in various places throughout thisspecification are not necessarily all referring to the same embodiment.Furthermore, the particular features, structures, or characteristics maybe combined in any suitable manner in one or more embodiments.

In some conventional digital imaging, if there is only one subject in ascene, an auto focus (AF) algorithm typically adjusts a lens position toset a focal distance on that one subject. Some embodiments are based ona realization by the inventors that, in some circumstances, thisapproach may be less than optimal for scenes with several objects, suchas human faces, located at various distances. Such embodiments variouslyimprove on conventional auto-focus techniques by providing mechanismswhich recognize that one field of focus, as compared to another field offocus, may result in a greater number and/or better arrangement ofin-focus objects.

As used herein, “field of view” refers to the portion of an environmentthat is observable through a lens system. A field of view may refer, forexample, to that portion of a three-dimensional environment, the imageof which may be captured as a two-dimensional image via a particularlens system directed at the portion. The term “field of focus” (also“focus field” or “focal field”) refers to that portion of the field ofview in which an object or objects, as observed through the lens system,will be sufficiently in-focus, according to some pre-determinedcriteria. A given field of focus—which may depend in part on a givenaperture of the imaging system, for example—comprises a respective focaldistance and a respective depth of field.

A “focal distance” is a distance from some reference point (e.g., acenter of a lens of the lens system) to the center of the focal field. A“depth of field” is a total depth of the field of focus (e.g., asmeasured along a line of direction extending to/from the referencepoint). The depth of field, which is also known as “focus range,”extends between a near depth of field and a far depth of field. The term“near depth of field” refers to a distance to a nearest edge of thedepth of field, as measured from a reference point such as a center of alens of the lens system. Similarly, “far depth of field” refers hereinto a distance from the reference point to a farthest edge of the depthof field.

For many optical systems, the relationship between focal distance(s) andnear depth of field (Dn) can—for example—be generally represented by thefollowing equation:s≈(Dn*H)/(H−Dn) for Dn<H,  (1)where the hyperfocal distance (H) is a closest distance at which a lenssystem can be focused while keeping objects at infinity acceptablysharp. Typically, when the lens is focused at the hyperfocal distance,all objects at distances from half of the hyperfocal distance out toinfinity will be acceptably sharp. The hyperfocal distance of an imagingsystem may be different for different settings (e.g., differentapertures) of that imaging system.

The relationship between Dn, s and H may also be generally representedby the following equations:Dn≈(Hs)/(H+s) for s<H,  (2)Dn≈H/2 for s≥H,  (3)and the relationship between far depth of field (Df), s and H may begenerally represented by the following equations:Df≈(Hs)/(H−s) for s<H,  (4)Df≈∞ for s≥H.  (5)However, any of a variety of additional or alternative criteria—e.g.,including one or more equations adapted from conventional imagingtechniques—may be used for identifying relationships between variousones of Dn, Df, H and s.

The phrase “focal configuration” refers herein to a given configurationof a lens system—e.g., one of multiple possible configurations—that isto facilitate the providing of a corresponding field of focus. The fieldof focus may be that of the lens system on its own. Alternatively, thefield of focus may be an overall field of focus provided by the lenssystem in combination with one or more other devices (e.g., includinganother one or more lenses, a particular aperture structure, circuitryto execute image focus software and/or the like).

Embodiments described herein variously determine—e.g., automatically—arelative preference of one focal configuration over another focalconfiguration, where such determining is based on an evaluation of anobject or objects that might be in a field of focus. Unless otherwiseindicated, “identified object” or “identified objects” variously referherein to one or more objects that are in a field of view of a lenssystem and that have each been identified (e.g., including beingdistinguished from one another) as having a respective distance fromsome reference such as a point located in or on a lens system. Such oneor more objects may include only a subset of a larger plurality ofobjects observable through the lens system (e.g., where the subsetincludes only objects which each take up at least some minimum portionof the field of view).

As used herein, an “in-focus object set” refers to a set of those one ormore identified objects which are, or would be, in-focus as observedwith the lens system during a particular focal configuration thereof.Various focal configurations of the lens system may thus correspond todifferent respective in-focus object sets. Of the one or more objects ina given in-focus object set, an object that is closest to the lenssystem may be referred to as a “nearest in-focus object,” whereas anobject that is farthest from the lens system is referred to as a“farthest in-focus object.” Accordingly, various in-focus object setsmay comprise different respective nearest in-focus objects and/orfarthest in-focus objects. A “count of in-focus objects” (for brevity,also referred to herein as “object count”) refers herein to a totalnumber of the one or more objects in an in-focus object set.

FIG. 1 illustrates elements of a system 100, according to an embodiment,to determine a focal configuration to be implemented for use in an imagecapture operation. System 100 is just one example of an embodimentconfigured to determine, based on respective distances of objects thatare within a field of view, a preference of one focal configuration overanother focal configuration. Such a preference may be determined, forexample, based on scores calculated each for a respective one of thefocal configurations. The scores may each be equal to, or otherwisebased on, a respective count of in-focus objects that is associated witha corresponding field of focus.

In the illustrative embodiment shown, system 100 includes a lens system110 comprising one or more lenses—such as the illustrative lens 112shown—to receive light 105 from an external environment. Lens system 110may include any of a variety of optical devices that accommodate anadjustable focus capability. Such an optical device may be controlled,based on techniques described herein, using one or more focus-adjustmentmechanisms adapted from conventional auto-focus technology.

Lens system 110 may be optically coupled to direct light 105 from theexternal environment toward an image sensor 120 of system 100—e.g.,wherein light output by lens system 110 is focused through an aperture122 onto a pixel array 124. Pixel array of 124 may include complementarymetal-oxide-semiconductor (CMOS) pixels and/or any of a variety of otherpixels adapted from conventional image sensing techniques. Someembodiments not limited to a particular pixel array architecture for usein generating image data based on light 105. In some embodiments, aconfiguration of lens system 110 is to be determined given a particularsize of aperture 122—e.g., wherein image sensor 120 is a fixed aperturedevice or wherein one focal configuration is to be selected from aplurality of possible focal configurations for use in combination with aparticular size of aperture 122.

For example, system 100 may further comprise a distance sensor 140configured to operate as a range-finder for detecting objects in a fieldof view which is observable with lens system 110. Detection of objectdistances with distance sensor 140 may include one or more operationsadapted from conventional range-finding techniques, which are notdetailed herein to avoid obscuring features of various embodiments. Byway of illustration and not limitation, distance sensor 140 may providefunctionality of a laser rangefinder, ultrasonic rangefinder or infraredrangefinder. Other means for range-finding are possible, such as lightdetection and ranging (LIDAR), radio detection and ranging (RADAR),microwave range-finding, etc.

Distance sensor 140 may be coupled to output signals 142 to distanceevaluation circuitry 150 of system 100. Distance evaluation circuitry150 may comprise logic—e.g., including an application specificintegrated circuit (ASIC), processor circuitry, state machine and/orother semiconductor hardware—configured to detect, based on signals 142,that multiple objects are in a field of view observable through lenssystem 110. Some or all such objects may be distinguishable from oneanother by different respective distances from system 100.

Range-finding with distance sensor 140 and distance evaluation circuitry150 may include active detection techniques, passive detectiontechniques (e.g., including phase detection, contrast measurement and/orthe like) or a combination thereof. In one embodiment, distanceevaluation circuitry 150 may identify, for each object of a plurality ofobjects, a respective distance to that object relative to some referencelocation in or on system 100. This identification may be based, forexample, on a threshold response to a laser and/or other range-findingsignal output from distance sensor 140. Such a minimum thresholdresponse may limit the identified plurality of objects to those objectswhich each occupy at least some minimum threshold amount of the field ofview. Alternatively or in addition, such a minimum threshold responsemay limit the identified plurality of objects to those objects in thefield of view which are within some maximum threshold distance fromsystem 100.

Although some embodiments are not limited in this regard, distancesensor 140 may provide directional range-finding functionality whichidentifies, for different respective portions of the field of view, adistance to a respective object, at least part of which occupies thatportion of the field of view. For example, distance sensor 140 may beoperated to sequentially (or otherwise) sweep the field of view, wherecorresponding response signals, received by distance sensor 140 insequence, are thus associated each with a different respective portionof the field of view. In such an embodiment, distance evaluationcircuitry 150 may correspond various object distances each with adifferent respective portion of the field of view.

System 100 may further comprise selection circuitry 160 coupled toreceive from distance evaluation circuitry 150 information thatspecifies or otherwise indicates the respective distances of theplurality of objects from system 100. Selection circuitry 160 maycomprise logic—e.g., including an ASIC, processor circuitry and/or thelike—to determine, based on such object distances, a focal configurationto implement with lens system 110. Such determining may includeselection circuitry 160 identifying a relative preference of some firstfocal configuration over a second focal configuration. This preferencemay be based, for example, on a determination that the first focalconfiguration would, as compared to the second focal configuration,result in a larger number and/or better arrangement (indicated by somescore or other metric) of in-focus objects.

In one illustrative embodiment, selection circuitry 160 includes orotherwise has access to reference information which describes one ormore relationships between a focal distance(s), near depth of field(Dn), far depth of field (Df), hyperfocal distance (H) and/or any ofvarious other optical characteristics to be provided with lens system100. By way of illustration and not limitation, selection circuitry 160may comprise or be coupled to a memory 130 which is preprogrammed withsuch reference information—e.g., by a manufacturer, retailer, computernetwork service or other agent. Based on object distance data fromdistance evaluation circuitry 150, selection circuitry 160 may accessreference information at memory 130 to select, calculate and/orotherwise determine, for a given distance of one such object, a totalnumber of objects that are (or would be) in focus during a correspondingfocal configuration of lens system 110. For example, the focalconfiguration may correspond to the object in question being located ata near depth of field to be provided with lens system 110.

Based on an evaluation of multiple possible focal configurations,selection circuitry 160 may output a signal 162 which identifies orotherwise indicates a focal configuration that has been determined to bepreferred over at least one alternative focal configuration. In responseto signal 162, a focus controller (FC) 170 of system 100 may adjust orotherwise configure a field of focus to be implemented with lens system110. FC 170 may include any of a variety of one or more hardware and/orsoftware mechanisms to change an effective focal distance provided withlens system 110. By way of illustration and not limitation, FC 170 mayinclude a motor to move lenses of lens system 110 relative to oneanother and/or relative to pixel array 124. Alternatively or inaddition, FC 170 may include logic (e.g., including an ASIC, processor,executing software and/or the like) that, for example, is to implementat least in part an effective field of focus by way of image processingcalculations. Based on signal 162, FC 170 may implement a focalconfiguration that provides a particular depth of field with lens system110. During such a focal configuration, image sensor 120 may beoperated—e.g., responsive to selection circuitry 160 and/or FC 170—tocapture an image of the external environment.

Although some embodiments are not limited in this regard, distanceevaluation circuitry 150 may further include or be coupled to imagerecognition circuitry (not shown) that is configured to receive andprocess image information generated by pixel array 124 based on lightreceived via lens system 110. Such image recognition circuitry may, forexample, be preprogrammed with (or otherwise have access to) otherreference information describing of one or more classes of objects.Based on such other reference information, the image recognitioncircuitry may evaluate signals from pixel array 124 to determine whetherany region of the field of view includes a representation of some objectbelonging to a predefined object class. Some examples of an objectclasses include, but are not limited to, an eye class, mouth class, headclass, automobile class, building class and/or the like. Identificationof one or more objects of an object class may include operations adaptedfrom conventional image recognition techniques. In an embodiment, one ormore object distances variously indicated by signals 142 may each beassociated with a respective object that is identified as belonging to acorresponding object class.

FIG. 2 illustrates elements of a method 200 to determine a focalconfiguration of the lens system according to an embodiment. Toillustrate certain features of various embodiments, method 200 isdescribed herein with reference to an example scenario illustrated inFIGS. 3A, 3B. FIG. 3A shows a top side view of an environment 300 inwhich an image sensor device 310 is to operate according to anembodiment. FIG. 3B shows a view 350 of various distances, as projectedonto a single line 360, from image sensor device 310 to respectiveobjects in environment 300. Method 200 may be performed with one or morecomponents of image sensor device 310—e.g., wherein image sensor device310 includes some or all features of system 100. However, otherembodiments include method 200 being performed by any of a variety ofother image sensor devices having features described herein.

In one embodiment, method 200 includes, at 210, identifying respectivedistances to each of a plurality of objects in a field of view of a lenssystem. For example, as shown in FIG. 3A, image sensor device 310 may bepositioned (located and oriented) such that some multiple objects, suchas the illustrative six objects A through F shown, are each in field ofview 320 (e.g., between lines of sight 322, 324) that is observablethrough a lens system 312 of image sensor device 310. The objects Athrough F are not limiting one some embodiments, and image sensor device310 may be configured to perform method 200 based on more, fewer and/ordifferently arranged objects.

Positions of objects in field of view 320 may be identified at least inpart with reference, for example, to a polar coordinate system (e.g.,part of a cylindrical or spherical coordinate system) comprising adistance dimension x and a radial dimension θ. In the illustrativescenario shown, field of view 320 has located therein object A atlocation (x1, θ4), object B at location (x2, θ3), object C at location(x3, θ2), object D at location (x4, θ5), object E at location (x5, θ6)and object F at location (x6, θ1). In the example scenario shown in FIG.3A, objects A through F are each in a two-dimensional plane. However, itwill be appreciated that some or all such objects may be variouslylocated at different vertical heights in a three-dimensional space—e.g.,where the vertical height component of an object's location may resultin some additional distance between the object and image sensor 310. Thedetermining at 210 may include, for example, identifying the distancesx1, x2, x3, x4, x5, x6—e.g., where such identifying is performed withdistance evaluation circuitry 150 based on signals 142.

Method 200 may further comprise performing a first determination of afocal configuration to be implemented (with lens system 312, in theexample of FIG. 3A). Such determining, also referred to herein as a“first focus determination” for brevity, may determine a focus of thelens system—e.g., including operations to provide a comparativeevaluation of at least two focal configurations based on respectivecounts of in-focus objects. For example, the first focus determinationmay include, at 220, determining a first count of any of the pluralityof objects to be in focus, while a first object of the plurality ofobjects is at a first near depth of field, due to a first focalconfiguration of the lens system and to a first aperture (i.e., aparticular aperture size which may be fixed or, alternatively,adjustable). The first count may represent a first total number of anyof the plurality of objects that would appear in focus if observed withthe lens system while the first field of focus is implemented with boththe first focal configuration and the first aperture.

The first focus determination may further comprise, at 230, determininga second count of any of the plurality of objects to be in focus, whilea second object of the plurality of objects is at a second near depth offield, due to a second focal configuration and to the first aperture.The second count may represent a second total number of any of theplurality of objects that would appear in focus if observed with thelens system while the second field of focus is implemented with a secondfocal configuration of the lens system and with the first aperture. Thedetermining at 230 may include counting a total number of objects of asecond in-focus object set which corresponds to the second focalconfiguration.

FIG. 3B illustrates one example of a focal configuration determination(such as that including the determining at 220 and 230) which comprisescounting, for each of a plurality of focal configurations, a respectivecounts of objects of an in-focus object set which corresponds to thatfocal configuration. Such a count (referred to herein as an “in-focusobject count”) may include setting a near depth of field variable to beequal to a distance of a particular object distance, and calculating orotherwise determining a far depth of field value that correspondsto—e.g., is to be concurrent with—the near depth of field value. Thedistances identified at 210 may then be evaluated to determine whichobjects are between the near depth of field and the corresponding fardepth of field.

For example, as shown in view 350, a focal configuration determinationmay perform a first in-focus object count for a field of focus D1wherein a near depth of field of D1 is to be at the same distance(x1-x0) from image sensor 310 as is object A. The first in-focus objectcount may determine that only one of the objects A through F—i.e.,object A—is (or would be) in focus when lens system 312 has a firstfocal configuration to facilitate D1. A second in-focus object count maybe performed for a field of focus D2 wherein a near depth of field of D2is to be at the same distance (x2-x0) from image sensor 310 as is objectB. The second in-focus object count may determine that a total of threeof the objects—i.e., objects B, C and D—are or would be in focus whenlens system 312 has a second focal configuration to facilitate D2.

The focal configuration determination may further perform a thirdin-focus object count for a field of focus D3 wherein a near depth offield of D3 is to be at the same distance (x3-x0) from image sensor 310as is object C. The third in-focus object count may determine that atotal of two of the objects—i.e., objects C and D—are or would be infocus when lens system 312 has a third focal configuration to facilitateD3. A fourth in-focus object count may be performed for a field of focusD4 wherein a near depth of field of D4 is to be at the same distance(x4-x0) from image sensor 310 as is object D. The fourth in-focus objectcount may determine that a total of two of the objects—i.e., objects Dand E—are or would be in focus when lens system 312 has a fourth focalconfiguration to facilitate D4.

The focal configuration determination may further perform a fifthin-focus object count for a field of focus D5 wherein a near depth offield of D5 is to be at the same distance (x5-x0) from image sensor 310as is object E. The fifth in-focus object count may determine that onlyone object—i.e., object E—is or would be in focus when lens system 312has a fifth focal configuration to facilitate D5. A sixth in-focusobject count may be performed for a field of focus D6 wherein a neardepth of field of D6 is to be at the same distance (x6-x0) from imagesensor 310 as is object F. The sixth in-focus object count may determinethat only one object—i.e., object F—is or would be in focus when lenssystem 312 has a sixth focal configuration to facilitate D6. Therespective depths of field of D1-D6 may be substantially equal—e.g.,within 10% of each other and, in some embodiments, within 5% of eachother.

The focal configuration determination performed by method 200 mayfurther comprise, at 240, performing a comparison of a first score basedon the first count determined at 220 and a second score based on thesecond count determined at 230. For example, the first score and thesecond score may be equal to the first count and the second count,respectively. In another embodiment, a score may be based at least inpart on a weighted value that has been assigned to an object in thefield of view. The assignment of such a weighted value may be based, forexample, on a location of the object in question in the field of view.By way of illustration and not limitation, a weight value may beassigned to an object based at least in part on a location of the objectrelative to a reference point or a reference line (e.g., a center, amidline, an edge and/or a corner) of the field of view. Alternatively orin addition, such a weight value may be assigned to the object based atleast in part on its position in the field of view relative to one ormore other objects that are also in the field of view. Such a weightvalue may additionally or alternatively be assigned based at least inpart on an object class type that has been identified, by imagerecognition processing, as corresponding to the object.

Based on a result of the comparison performed at 240, method 200 mayfurther comprise, at 250, providing a signal indicating a preferencebetween the first focal configuration or the second focal configuration.For example, the signal may specify or otherwise indicate that the firstfocal configuration is to be preferred over the second focalconfiguration. The signal provided at 250 may indicate that the firstfield of focus, to be provided with the first focal configuration, is toresult in a larger number of—and/or a better weighted score for—in-focusobjects, as compared to a second field of focus that might otherwise beprovided by the second focal configuration.

Referring again to the example scenario shown in FIG. 3B, the signal at250 may indicate a preference for the focal configuration thatfacilitates D2 over the focal configuration that facilitates D1. Such asignal may identify the focal configuration that, of a plurality of suchconfigurations, is to result in the largest number of in-focus objects.In some embodiments, the signal provided at 250 may be generatedindependent of any count of objects that are to be in focus while eachof the plurality of objects is offset from a near depth of field—e.g.,independent of any determining of an in-focus object count whichcorresponds to a focal configuration other than one that is to place oneof the plurality of objects at a near depth of field. For example, afocal configuration determination performed for objects A through F infield of view 320 may include performing only six in-focus objectcounts—i.e., each for a respective one of the fields of focus D1 throughD6 shown.

Conventional techniques to determine lens focusing variously sweepacross a range of focal distances, performing respective calculationsfor each of a large set of fields of focus. This larger set typicallyincludes many fields of focus for which no identified object is (orwould be) located at the near depth of field. By contrast, someembodiments calculate scores for a relatively smaller, more particularset of fields of focus—e.g., the total number of which may be not morethan a total number of the plurality of objects. The comparativeevaluation of only D1 through D6—e.g., without also evaluating manyother intermediate fields of focus each between respective ones of D1through D6—illustrates one efficiency obtained by many such embodiments.As compared to conventional techniques, such embodiments are moreefficient by providing relatively simpler, and thus faster, processingto evaluate fields of focus.

Although some embodiments are not limited in this regard, method 200 maycomprise one or more additional operations (not shown) to operate animage sensor device based on the signal provided at 250. For example,method 200 may further comprise configuring the lens system based on thesignal provided at 250—e.g., wherein the lens system is to implement thefirst configuration to locate at a near depth of field the first object.In such an embodiment, an object other than the first object may be aclosest object (of all of the plurality of objects) to the lens array.After configuring the lens system, method 200 may further operate apixel array to capture an image received with the lens system. Althoughsome embodiments are not limited in this regard, method 200 may berepeated one or more times—e.g., including selection circuitry 160 (forexample) performing one or more additional focus determinations of aplurality of focus determinations including the first focusdetermination. For example, some or all of such a plurality of focusdeterminations may each correspond to a different respective aperturethat is to operate with the lens system.

FIG. 4 illustrates elements of a method 400 to determine a focalconfiguration according to an embodiment. Method 200 may be performedwith system 100 or image sensor device 310, for example. In anembodiment, method 200 includes some or all of the features of method200.

In the illustrative embodiment shown, method 400 includes operations toinitialize variables used in determining a preferred focalconfiguration. By way of illustration and not limitation, suchoperations may include, at 405, setting to zero each of a variable Dmaxrepresenting a currently preferred near field of focus and anothervariable Nmax representing an in-focus object count corresponding toDmax. The operations at 405 may additionally or alternatively includesetting a counter variable x to an initial value—e.g., one (1).

Method 400 may further comprise, at 410, determining a distance dx ofthe xth object (where xth is an ordinal corresponding to a current valueof variable x) of a plurality of objects that have been determined to bewithin a field of view that is observable via a lens system. Thedistance dx may be determined with respect to a reference location suchas a center point in or on a lens of the lens system. At 415, method 400may determine a value Nx representing an in-focus object count—i.e., acount of objects that are (or would be) in-focus while the lens systemhas a focal configuration that puts the xth object at a near field offocus. The determining at 415 may include one or more operations such asthose of the determining at 220 or the determining at 230, for example.

Method 400 may further include determining, at 420, whether the value Nxmost recently determined at 415 is greater than a current value of Nmax.Where it is determined at 420 that Nmax is greater than the current Nmaxvalue, method 400 may perform operations, at 425, including setting Nmaxto be equal to the most recently determined value of Nx. The operationsat 425 may further comprise setting Dmax to be equal to the mostrecently determined value of Dn. Subsequently, a determination may bemade, at 430, as to whether any other object of the plurality of objectsremain to be addressed by method 400. Where it is instead determined at420 that Nmax is less than (or equal to, in some embodiments) thecurrent Nmax value, method 400 may forego an instance of the operationsat 425, and proceed to the determining at 430.

In response to a determination at 430 that each of the plurality ofobjects have been addressed, method 400 may proceed to, or be followedby, subsequent operations (not shown) to implement at the lens system afocal configuration that provides a near depth of field equal to themost recent value of Dmax. Where it is instead determined at 430 that atleast one of the plurality of objects has not been addressed, method 400may increment the counter x, at 435, and proceed to perform (for thenewly incremented value of x) another instance of the determining at410.

In one embodiment, the initial xth object—i.e., a first object—of theplurality of objects to be addressed by method 400 is a closest objectof the plurality of objects to the lens system. Each next xth object tobe addressed by method 400 may, for example, be a next object furtheraway from the lens system. In such an embodiment, one or more additionaltest conditions (not shown) may be evaluated to determine whether anexit from method 400 is to be performed.

By way of illustration and not limitation, an early exit from method 400may be performed in response to a determination—e.g., at 420—that Nxrepresents the xth object and all other objects (of the plurality ofobjects) that are further away from the lens system than the xth object.Alternatively or in addition, an early exit from method 400 may beperformed in response to a determination—e.g., at 420—that anysubsequent evaluation of Nx could not be larger than the current valueof Nmax (e.g., where method 400 is to address objects successivelyaccording to the increasing order of their respective distances from thelens system).

FIG. 5 illustrates features of an embodiment wherein a focalconfiguration of a lens system is determined based on respective scoresfor objects in a field of view, wherein the scores are in turndetermined based on different weight values assigned to various ones ofthe objects. Such determining may be performed, for example, by onesystem 100 or image sensor device 310—e.g., according to one of methods200, 400.

FIG. 5 shows a top side view of an environment 500 in which an imagesensor device 510 is to operate according to an embodiment. As shown inFIG. 5, image sensor device 510 may be positioned (located and oriented)such that objects—e.g., the illustrative plurality of objects A throughF shown—are each in field of view 520, between lines of sight 522, 524,that is observable through a lens system 512 of image sensor device 510.Image sensor device 510 may be positioned to additionally oralternatively image more, fewer and/or differently arranged objects, invarious embodiments.

FIG. 5B shows one example view 550 of objects A through F (being people,in the illustrative scenario) that are within field of view 520, theview 550 as seen through lens system 512. A focal configuration for lenssystem 512 may be determined, for example, based in part the respectivedistances x1 though x6 of objects A through F from lens system 512. Insome embodiments, such determining of a focal configuration may befurther based on respective locations of some or all of objects Athrough F in view 550.

For example, preprogrammed reference information—e.g., stored in memory130—may correspond different regions of view 550 each with a respectivevalue indicating a degree of value placed on objects in that region. Inthe illustrative embodiment shown, such regions include a region 554 inwhich is located a center of view 550 (the center aligned withcenterline 526 of field of view 520). The regions may further include aregion 556 adjoining, and extending around, region 554, as well asanother region 558 adjoining, and extending around, region 556. Stillanother region around 558 may extend to an edge 552 of view 550.

For a given one of such regions, an object identified as being in theregion may be assigned a weight which is equal to or otherwise based onthe predefined preference value associated with that region. In theillustrative embodiment shown, object A may be assigned a first weightcorresponding to region 554, and objects B, C and D may each be assigneda second weight corresponding to region 558. Objects E and F may each beassigned a third weight corresponding to the region which adjoins andsurrounds region 558.

A score S_(x) may be calculated a given focal configuration Cx of lenssystem 512—e.g., where Cx provides a near depth of field that is equalto the distance of the xth object of the plurality of objects from lenssystem 512. In one embodiment, a S_(x) value may be calculated accordingto the following:

$\begin{matrix}{S_{x} = {\sum\limits_{i = 1}^{I}{( B_{ix} )( W_{i} )}}} & (6)\end{matrix}$wherein I is an integer equal to a total number of the plurality ofobjects, B_(ix) is a Boolean value that is equal to “1” if the ithobject is or would be in focus during Cx (and equal to “0” otherwise),and W_(i) is a weight value associated with the region of view 550 inwhich the ith object is located. In some other embodiments, a givenweight value W_(i) may be additionally or alternatively determined basedon an object type to which a corresponding ith object belongs. By way ofillustration and not limitation, a weight value W_(i) may be relativelymore significant where image recognition processing has identified thecorresponding ith object as being one instance of a human face (orportion thereof) object type. The assigning of particular weights torespective objects may be based on any of a wide variety of possibleobject type preferences that are preprogrammed or otherwise determinedin advance—e.g., by a manufacturer, retailer, user or other agent. Inone illustrative embodiment, a relatively more significant (e.g., largervalue) weight may be assigned to objects of a human face object type, ascompared to one or more alternative object types. However, thetechniques by which such preferences are to be determined may dependupon implementation-specific details, and may not be limiting on someembodiments. As contrasted with an in-focus object count, a S_(x) value(or a W_(i) value) may be a number other than any integer, for example.Equation (6) is merely one example calculation for determining S_(x) fora given xth object. Any of a variety of other calculations to determinea S_(x) value may be performed, according to different embodiments.

Some embodiments may calculate respective S_(x) values for two or moreof—e.g., each of—the I objects that are identified as being located infield of view 520. Lens system 512 may be subsequently configured basedon such an evaluation of such scores. For example, a focal configurationof lens system 512 may be implemented based on that focal configurationhaving a greatest S_(x) value. In some scenarios, two or more focalconfigurations may each have the same S_(x) value—e.g., where that S_(x)value is greater than any of the other calculated S_(x) values. In suchan embodiment, one of such two of more focal configurations may beselected for implementation based on that focal configuration having ashortest focal distance, as compared to the others of the two of morefocal configurations.

Techniques and architectures for operating an optical device aredescribed herein. Some portions of the detailed description herein arepresented in terms of algorithms and symbolic representations ofoperations on data bits within a computer memory. These algorithmicdescriptions and representations are the means used by those skilled inthe computing arts to most effectively convey the substance of theirwork to others skilled in the art. An algorithm is here, and generally,conceived to be a self-consistent sequence of steps leading to a desiredresult. The steps are those requiring physical manipulations of physicalquantities. Usually, though not necessarily, these quantities take theform of electrical or magnetic signals capable of being stored,transferred, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise as apparent from the discussion herein, itis appreciated that throughout the description, discussions utilizingterms such as “processing” or “computing” or “calculating” or“determining” or “displaying” or the like, refer to the action andprocesses of a computer system, or similar electronic computing device,that manipulates and transforms data represented as physical(electronic) quantities within the computer system's registers andmemories into other data similarly represented as physical quantitieswithin the computer system memories or registers or other suchinformation storage, transmission or display devices.

Certain embodiments also relate to apparatus for performing theoperations herein. This apparatus may be specially constructed for therequired purposes, or it may comprise a general purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program may be stored in a computerreadable storage medium, such as, but is not limited to, any type ofdisk including floppy disks, optical disks, CD-ROMs, andmagnetic-optical disks, read-only memories (ROMs), random accessmemories (RAMs) such as dynamic RAM (DRAM), EPROMs, EEPROMs, magnetic oroptical cards, or any type of media suitable for storing electronicinstructions, and coupled to a computer system bus.

The algorithms and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general purposesystems may be used with programs in accordance with the teachingsherein, or it may prove convenient to construct more specializedapparatus to perform the required method steps. The required structurefor a variety of these systems will appear from the description herein.In addition, certain embodiments are not described with reference to anyparticular programming language. It will be appreciated that a varietyof programming languages may be used to implement the teachings of suchembodiments as described herein.

Besides what is described herein, various modifications may be made tothe disclosed embodiments and implementations thereof without departingfrom their scope. Therefore, the illustrations and examples hereinshould be construed in an illustrative, and not a restrictive sense. Thescope of the invention should be measured solely by reference to theclaims that follow.

What is claimed is:
 1. A device comprising: a lens system to receivelight from an environment external to the device; distance evaluationcircuitry configured to identify respective distances to each of aplurality of objects including a first object and a second object;selection circuitry coupled to the distance evaluation circuitry todetermine a focus of the lens system, the selection circuitry includinglogic that when executed causes the device to perform operationsincluding: adjusting the lens system to have a first focal configurationand a first aperture in which the first object is at a first near depthof field; determining a first count of any of the plurality of objectsto be in focus, while the first object is at the first near depth offield, due to the first focal configuration and to the first aperture,wherein the first count represents a number of objects in focus whilethe first object is at the first near depth of field; adjusting the lenssystem to have a second focal configuration and the first aperture inwhich the second object is at a second near depth of field; determininga second count of any of the plurality of objects to be in focus, whilethe second object is at the second near depth of field, due to thesecond focal configuration and to the first aperture, wherein the secondcount represents a number of objects in focus while the second object isat the second near depth of field; comparing a first score based on thefirst count that results from the first focal configuration and a secondscore based on the second count that results from the second focalconfiguration, to identify a preference between the first focalconfiguration and the second focal configuration based on which focalconfiguration provides a larger number of in-focus objects; andproviding, based on the comparing of the first score and the secondscore, a signal which indicates the preference between the first focalconfiguration and the second focal configuration based on which focalconfiguration provides a larger number of in-focus objects; a focuscontroller coupled to adjust the lens system based on the signal; and animage sensor optically coupled to capture an image received with thelens system after the lens system has been adjusted based on the signal.2. The device of claim 1, wherein the selection circuitry is configuredto cause the device to generate the signal which indicates thepreference between the first focal configuration and the second focalconfiguration independent of the device performing any count of objectsbeing in focus while all of the plurality of objects are offset from anear depth of field for a present focal configuration.
 3. The device ofclaim 1, wherein the selection circuitry is configured to cause thedevice to determine one or more other focuses of the lens system, eachof the one or more of the other focuses due in part to a respectiveaperture other than the first aperture.
 4. The device of claim 1,wherein the signal indicates the preference for the first focalconfiguration, and an object other than the first object, of theplurality of objects, is a closest object to the lens array while thelens system has the first focal configuration.
 5. The device of claim 1,wherein the selection circuitry is configured to cause the device tocalculate the first score based on a first weight value assigned to anobject based on a location of the object in the field of view.
 6. Thedevice of claim 5, wherein the location of the object in the field ofview is relative to a reference point or a reference line of the fieldof view.
 7. The device of claim 6, wherein the reference point is acenter of the field of view.
 8. The device of claim 5, wherein thelocation of the object in the field of view is relative to anotherobject of the plurality of objects.
 9. The device of claim 5, whereinthe first score includes a number other than any integer.
 10. The deviceof claim 1, wherein selection circuitry is configured to cause thedevice to calculate the first score based on a first weight valueassigned to an object based on an object type of the object.
 11. Thedevice of claim 10, wherein the object type includes a human face objecttype.
 12. A non-transitory computer-readable storage medium havingstored thereon instructions which, when executed by one or moreprocessing units, cause the one or more processing units to perform amethod comprising: identifying respective distances to each of aplurality of objects in a field of view of a lens system, the pluralityof objects including a first object and a second object; determining afocus of the lens system, including: adjusting the lens system to have afirst focal configuration and a first aperture in which the first objectis at a first near depth of field; determining a first count of any ofthe plurality of objects to be in focus, while the first object is atthe first near depth of field, due to the first focal configuration andto the first aperture, wherein the first count represents a number ofobjects in focus while the first object is at the first near depth offield; adjusting the lens system to have a second focal configurationand the first aperture in which the second object is at a second neardepth of field; determining a second count of any of the plurality ofobjects to be in focus, while the second object is at the second neardepth of field, due to the second focal configuration and to the firstaperture, wherein the second count represents a number of objects infocus while the second object is at the second near depth of field;comparing a first score based on the first count that results from thefirst focal configuration and a second score based on the second countthat results from the second focal configuration, to identify apreference between the first focal configuration and the second focalconfiguration based on which focal configuration provides a largernumber of in-focus objects; and providing, based on the comparing of thefirst score and the second score, a signal which indicates thepreference between the first focal configuration and the second focalconfiguration based on which focal configuration provides a largernumber of in-focus objects; adjusting the lens system based on thesignal; and capturing an image received with the lens system after thelens system has been adjusted based on the signal.
 13. Thenon-transitory computer-readable storage medium of claim 12, wherein thesignal which indicates the preference between the first focalconfiguration and the second focal configuration is generatedindependent of performing any count of objects being in focus while allof the plurality of objects are offset from a near depth of field for apresent focal configuration.
 14. The non-transitory computer-readablestorage medium of claim 12, the method further comprising determiningone or more other focuses of the lens system, each of the one or more ofthe other focuses due in part to a respective aperture other than thefirst aperture.
 15. The non-transitory computer-readable storage mediumof claim 12, wherein the signal indicates the preference for the firstfocal configuration, and an object other than the first object, of theplurality of objects, is a closest object to the lens array while thelens system has the first focal configuration.
 16. The non-transitorycomputer-readable storage medium of claim 12, the method furtherincluding calculating the first score based on a first weight valueassigned to an object based on a location of the object in the field ofview.
 17. The non-transitory computer-readable storage medium of claim16, wherein the location of the object in the field of view is relativeto a reference point or a reference line of the field of view.
 18. Thenon-transitory computer-readable storage medium of claim 16, wherein thelocation of the object in the field of view of relative to anotherobject of the plurality of objects.
 19. A method comprising: identifyingrespective distances to each of a plurality of objects in a field ofview of a lens system, the plurality of objects including a first objectand a second object; determining a focus of the lens system, including:adjusting the lens system to have a first focal configuration and afirst aperture in which the first object is at a first near depth offield; determining a first count of any of the plurality of objects tobe in focus, while the first object is at the first near depth of field,due to the first focal configuration and to the first aperture, whereinthe first count represents a number of objects in focus while the firstobject is at the first near depth of field; adjusting the lens system tohave a second focal configuration and the first aperture in which thesecond object is at a second near depth of field; determining a secondcount of any of the plurality of objects to be in focus, while thesecond object is at the second near depth of field, due to the secondfocal configuration and to the first aperture, wherein the second countrepresents a number of objects in focus while the second object is atthe second near depth of field; comparing a first score based on thefirst count that results from the first focal configuration and a secondscore based on the second count that results from the second focalconfiguration, to identify a preference between the first focalconfiguration and the second focal configuration based on which focalconfiguration provides a larger number of in-focus objects; andproviding, based on the comparing of the first score and the secondscore, a signal which indicates the preference between the first focalconfiguration and the second focal configuration based on which focalconfiguration provides a larger number of in-focus objects; adjustingthe lens system based on the signal; and capturing an image receivedwith the lens system after the lens system has been adjusted based onthe signal.
 20. The method of claim 19, wherein the signal whichindicates the preference between the first focal configuration and thesecond focal configuration is generated independent of performing anycount of objects being in focus while all of the plurality of objectsare offset from a near depth of field for a present focal configuration.21. The method of claim 19, wherein the signal indicates the preferencefor the first focal configuration, and an object other than the firstobject, of the plurality of objects, is a closest object to the lensarray while the lens system has the first focal configuration.
 22. Themethod of claim 19, further including calculating the first score basedon a first weight value assigned to an object based on a location of theobject in the field of view.